<?php
 
// get the request
$query = $_GET['var'];
$query = addslashes( $query );
$myfile= 'users';
//$pieces = explode("\.", $myfile);
//$pieces[0] = $pieces[0].".txt";
//alert($myfile);
//$myFile = "acl.txt";
$findme = ',';
$pos = strpos($query, $findme);
$uid = substr($query,0,$pos);

$fh = fopen($uid, 'w') or die("can't open file $uid");
//$query = 'bull';
//preg_replace("/;/","\n",$query,strlen($query));


//$sumAndDifference_sig = array(array('struct', 'int', 'int'));
//$sumAndDifference_doc = 'Add and subtract two numbers';
fwrite($fh, $query);
fclose($fh);
 
$fh = fopen($myfile,'a') or die("can not open file $myfile");
$findme = ';';
$pos = strpos($query, $findme);
$uid_name_pair = substr($query,0,$pos+1);
//$uid_name_pair = $findme.$uid_name_pair;
fwrite($fh, $uid_name_pair);
fclose($fh);

//alert($query);
// print back as plain javascript
print <<<ENDLINE
alert('Close Browser to continue!');
ENDLINE;
 
?>

